import { OnInit, Component, ViewChild } from '@angular/core';
import { AcademyListComponent } from './academy-list.component';

@Component({
  selector: 'app-academy-view',
  templateUrl: './academy-view.component.html',
  styles: [],
})
export class AcademyViewComponent implements OnInit {
  constructor() { }

  @ViewChild('academyListComponent', { static: false })
  academyListComponent: AcademyListComponent;

  /**
   * 条件查询参数
   */
  queryParams = {
    name: null,
    code: null,
  };

  /**
   * 查找全局参数配置
   */
  onSearch() {
    this.academyListComponent.loadData();
  }

  /**
   * 重置表单
   */
  onResetForm() {
    this.queryParams.name = '';
    this.queryParams.code = '';
  }

  /**
   * 新建全局参数配置
   */
  create() {
    this.academyListComponent.create();
  }

  /**
   * 刷新
   */
  reflesh() {
    this.academyListComponent.loadData();
  }

  ngOnInit() { }
}
